<template>
  <div>
    <div>
      <van-nav-bar
        fixed
        title="写评分"
        left-text="返回"
        left-arrow
        @click-left="$router.go(-1)"
      />
    </div>
    <div class="inform">
      <van-notice-bar color="#DEB887" background="#FFF8DC">
        审核通过后，有机会获得成长值哟
      </van-notice-bar>
    </div>
    <div class="myTitle">
      <span>长津湖之水门桥</span>
    </div>
    <div class="graded">
      <div>
        评分：
        <van-rate
          v-model="starValue"
          touchable
          allow-half
          void-icon="star"
          void-color="#eee"
        />
      </div>
      <span>{{ starValue * 2 }}分</span>
    </div>
    <van-divider
      :style="{
        color: '#1989fa',
        borderColor: '#DCDCDC',
        padding: '10px 16px 0px 16px',
      }"
    >
    </van-divider>
    <van-field
      v-model="message"
      rows="8"
      autosize
      type="textarea"
      maxlength="150"
      placeholder="大家都在问：剧情怎么样，演技怎么样？"
      show-word-limit
    />
    <div class="base">
      <button @click="issue" v-if="starValue&&message!=''">发布</button>
      <van-button type="primary" disabled v-else>发布</van-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      starValue: 0,
      message: "",
      isHide: 1,
    };
  },
  methods: {
    issue() {
      //将评分分数传递到看过页面
      this.$router.push({
        path: "/me/watched",
        query: {value:this.starValue,comment:this.message,hide:this.isHide}
      });
    },
  },
};
</script>

<style scoped>
.inform {
  background-color: #fff8dc;
  margin-top: 3rem;
}
.van-notice-bar {
  font-size: 15px;
}
.myTitle {
  margin-left: 1.2rem;
  margin-top: 1.1rem;
}
.myTitle span {
  font-size: 1.2rem;
}
.graded {
  margin-left: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-left: 1.2rem;
  margin-top: 1.1rem;
  margin-right: 1.2rem;
  font-size: 14px;
}
.van-cell::after {
  border-bottom: 2px solid #dcdcdc;
}
.base {
  margin-top: 40%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.base button {
  width: 80%;
  padding: 0.7rem;
  border-radius: 35px;
  background-color: rgb(247, 54, 54);
  color: aliceblue;
  border: 1px solid red;
}
.van-field {
  font-size: 16px;
}
</style>
